// DeviceFactory.cpp
std::shared_ptr<Device> DeviceFactory::createDevice(const std::string& type, const std::string& config) {
    if (type == "Lamp") return std::make_shared<Lamp>(config);
    if (type == "Thermostat") return std::make_shared<Thermostat>(config);
    throw std::runtime_error("Unknown device type");
}